/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author machine
 */
@Entity
@Table(name = "idiomapeliculas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Idiomapeliculas.findAll", query = "SELECT i FROM Idiomapeliculas i"),
    @NamedQuery(name = "Idiomapeliculas.findByIdidomapeliculas", query = "SELECT i FROM Idiomapeliculas i WHERE i.ididomapeliculas = :ididomapeliculas")})
public class Idiomapeliculas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ididomapeliculas")
    private Integer ididomapeliculas;
    @JoinColumn(name = "ididiomas", referencedColumnName = "ididiomas")
    @ManyToOne(optional = false)
    private Idiomas ididiomas;
    @JoinColumn(name = "idpeliculas", referencedColumnName = "idpeliculas")
    @ManyToOne(optional = false)
    private Peliculas idpeliculas;

    public Idiomapeliculas() {
    }

    public Idiomapeliculas(Integer ididomapeliculas) {
        this.ididomapeliculas = ididomapeliculas;
    }

    public Integer getIdidomapeliculas() {
        return ididomapeliculas;
    }

    public void setIdidomapeliculas(Integer ididomapeliculas) {
        this.ididomapeliculas = ididomapeliculas;
    }

    public Idiomas getIdidiomas() {
        return ididiomas;
    }

    public void setIdidiomas(Idiomas ididiomas) {
        this.ididiomas = ididiomas;
    }

    public Peliculas getIdpeliculas() {
        return idpeliculas;
    }

    public void setIdpeliculas(Peliculas idpeliculas) {
        this.idpeliculas = idpeliculas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ididomapeliculas != null ? ididomapeliculas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Idiomapeliculas)) {
            return false;
        }
        Idiomapeliculas other = (Idiomapeliculas) object;
        if ((this.ididomapeliculas == null && other.ididomapeliculas != null) || (this.ididomapeliculas != null && !this.ididomapeliculas.equals(other.ididomapeliculas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beans.Idiomapeliculas[ ididomapeliculas=" + ididomapeliculas + " ]";
    }
    
}
